package com.zzty.txj1.dao;


import com.zzty.txj1.entity.Question;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface QuestionDao {
    @Insert("insert into question (content) values(#{content})")
    Integer addContent(Question question);

    @Select("select * from question")
    List<Question> getAllQuestion();

    @Select("select * from question")
    public List<Question> getQuestion();

    @Select("select count(*) from question")
    public Integer getQuestionCount();

    @Insert("insert into question (content) values (#{content})")
    public Integer addQuestion(Question question);

    @Select("select content from question where id=#{id}")
    String getContentById(Question question);

    @Select("select * from question where id=#{id}")
    Question getQuestionById(Question question);

    @Select("select max(id) from question")
    Integer getMaxQuestionId();
}

